package debtbundler.domain.bll;

import java.io.Serializable;

import debtbundler.domain.entity.Payment;
import debtbundler.domain.entity.Share;

public class PaymentSharePair implements Serializable {
	private static final long serialVersionUID = 1L;
	
	private Payment payment;
	private Share share;
	
	public PaymentSharePair(Payment payment, Share share) {
		this.payment = payment;
		this.share = share;
	}

	public Payment getPayment() {
		return payment;
	}

	public void setPayment(Payment payment) {
		this.payment = payment;
	}

	public Share getShare() {
		return share;
	}

	public void setShare(Share share) {
		this.share = share;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((payment == null) ? 0 : payment.hashCode());
		result = prime * result + ((share == null) ? 0 : share.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		PaymentSharePair other = (PaymentSharePair) obj;
		if (payment == null) {
			if (other.payment != null)
				return false;
		} else if (!payment.equals(other.payment))
			return false;
		if (share == null) {
			if (other.share != null)
				return false;
		} else if (!share.equals(other.share))
			return false;
		return true;
	}
	
	
}
